package com.taikang.service.impl;

import com.taikang.dao.MessageDao;
import com.taikang.dao.PushDao;
import com.taikang.dao.UserDao;
import com.taikang.service.PushService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by zhai on 16/5/14.
 */
@Service
public class PushServiceImpl implements PushService {

    private PushDao pushDao;
    private UserDao userDao;
    private MessageDao messageDao;

    @Autowired
    public void setMessageDao(MessageDao messageDao) {
        this.messageDao = messageDao;
    }

    @Autowired
    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    @Autowired
    public void setPushDao(PushDao pushDao) {
        this.pushDao = pushDao;
    }

    @Override
    public Object getPushList(Integer productId, Integer page, Integer size) {
        return pushDao.getProductInfo(productId, page, size);
    }

    @Override
    public Object getPushUserList(Integer employeeId, Integer page, Integer size) {
        return userDao.getUserInfo(employeeId, page, size);
    }

    @Override
    public boolean addMessage(Integer userId, Integer employeeId, String name) {
        return messageDao.addMessage(userId, employeeId, name);
    }
}
